import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/layout/index.vue'

import login from '@/views/login/mylogin';

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    component: login,
    children: [
      {
        path: '',
        name: 'login',
        component: () => import(/* webpackChunkName: "about" */ '../views/login/mylogin.vue')
      },

    ]
  },
  {
    path: '/home',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: '',
        name: 'home',
        component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue')
      },
    ]
  },

  {
    path: '/user',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: 'list',
        name: 'user-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/list.vue')
      }
    ]
  },
  {
    path: '/employee',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: 'list',
        name: 'employee-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/employee/list.vue')
      }
    ]
  },

  {
    path: '/goods',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: 'servicelist',
        name: 'serveice-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/goods/servicelist.vue')
      },
      {
        path: 'partslist',
        name: 'partslist-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/goods/partslist.vue')
      }
    ]
  },

  {
    path: '/order',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: 'orderlist',
        name: 'order-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/orderlist.vue')
      },
    ]
  },


  {
    path: '/swiper',
    component: layout,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path: 'indexswiper',
        name: 'indexswiper',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/orderlist.vue')
      },
      {
        path: 'detailswiper',
        name: 'indexswiper',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/orderlist.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
